package com.ibeeking.found.common.enums.msg;

/**
 * @Author ibeeking
 * @Description: 消息类别
 */
public enum MsgCategoryEnum {
    BUYER_ORDER_MSG("订单消息", 1),
    BUYER_AFTER_SALES("售后消息", 2),
    BUYER_COUPON_MSG("优惠券消息", 3),
    BUYER_MEMBER_MSG("会员消息", 4),
    BUYER_CAMPAIGN_MSG("营销活动", 5),
    BUYER_DISCUSS_MSG("评论消息", 6),
    BUYER_MASSTEXTING_MSG("群发消息", 7),
    BUYER_GIFT_MSG("赠送消息", 8),
    BUYER_PARKING_MSG("停车收费", 9),
    BUYER_OTHER_MSG("其他消息", 10),
    SELLER_ORDER_MSG("订单提醒消息", 21),
    SELLER_LOGISTICS_MSG("收发货提醒消息", 22),
    SELLER_AFTERSALES_MSG("售后服务提醒消息", 23),
    SELLER_MEMBER_MSG("会员提醒消息", 24),
    SELLER_FINANCE_MSG("支付结算提醒", 25),
    SELLER_OTHER_MSG("其他提醒消息", 26),
    PLATFORM_NOTICE_MSG("公告消息", 41),
    PLATFORM_SYSTEM_MSG("系统消息", 42),
    PLATFORM_SERVICE_MSG("服务消息", 43),
    PLATFORM_OTHER_MSG("其他消息", 44),
    ;

    private String name;
    private Integer code;

    MsgCategoryEnum(String name, Integer code) {
        this.name = name;
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public Integer getCode() {
        return code;
    }

    public static String getNameByCode(Integer code) {
        for (MsgCategoryEnum enumObj : values()) {
            if (enumObj.getCode().equals(code)) {
                return enumObj.getName();
            }
        }
        return null;
    }

    public static MsgCategoryEnum getEnumByCode(Integer code) {
        for (MsgCategoryEnum enumObj : values()) {
            if (enumObj.getCode().equals(code)) {
                return enumObj;
            }
        }
        return null;
    }
}
